<template>
  <div id="app">
    <TopHead :key="$store.state.topHeadKey"></TopHead>
    <Nav></Nav>
    <router-view />
    <Footer></Footer>
    <transition name="scale">
      <Login v-show="$store.state.isShowLoginBox"></Login>
    </transition>
    <transition name="toast">
      <Toast v-show="$store.state.isShowToast"></Toast>
    </transition>
  </div>
</template>
<script>
import TopHead from "./components/common/TopHead.vue";
import Nav from "./components/common/Nav.vue";
import Footer from "./components/common/Footer.vue";
import Login from "./components/common/Login.vue";
import Toast from "./components/common/Toast.vue";
export default {
  components: {
    TopHead,
    Nav,
    Footer,
    Login,
    Toast,
  },
};
</script>
<style lang="less">
.scale-enter {
  // transform: scale(0);
  opacity: 0;
}
.scale-enter-active {
  // transition:transform 1s;
  transition: opacity 1s;
}
.scale-enter-to {
  // transform: scale(1);
  opacity: 1;
}

// login 里面的toast组件的动画
.toast-enter,
.toast-leave-to {
  // opacity: 0;
  top: -80px;
}
.toast-enter-active,
.toast-leave-active {
  transition: 0.5s;
}
.toast-enter-to,
.toast-leave {
  // opacity: 1;
  top: 50px;
}
</style>
